Skip to content

feat: support last cycle prime summary modal#5630

Open
cuzz-venus wants to merge 5 commits into
feat/prime-total-rewardsfrom
feat/prime-last-cycle-summary
Open

feat: support last cycle prime summary modal#5630
cuzz-venus wants to merge 5 commits into
feat/prime-total-rewardsfrom
feat/prime-last-cycle-summary

Conversation

@cuzz-venus

@cuzz-venus cuzz-venus commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Jira ticket(s)

no tickets only want separate PR for cycle summary modal

Changes

  • add last cycle summary modal since need reuse total rewards card / user rewards card.

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd2ecf9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jun 17, 2026 10:07am
dapp-testnet Ready Ready Preview Jun 17, 2026 10:07am
venus.io Ready Ready Preview Jun 17, 2026 10:07am

Request Review

@greptile-apps

greptile-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a LastCycleSummaryModal that reuses the existing TotalRewardsCard and UserRewardsCard components to display prior-cycle Prime reward data, and extracts a new PrimeRewardBadge component to avoid duplication. Both card components receive optional title and content/showMarketActions props to support a read-only summary context without breaking existing usages.

  • LastCycleSummaryModal wires together the two reward cards with last-cycle-specific titles and a conditional eligibility message; all data is currently placeholder with TODO comments marking where API integration will go.
  • TotalRewardsCard and UserRewardsCard are extended with optional props that fall back to existing behaviour when not provided, keeping the changes backward-compatible.
  • Seven locale files each receive a new lastCycleSummary translation block covering the modal title, card titles, and eligible/not-eligible messages.

Confidence Score: 5/5

Safe to merge; all changes are additive and the existing card components remain backward-compatible via optional props with sensible fallbacks.

The new modal is entirely placeholder-driven with explicit TODO comments, the component extensions use optional props that don't affect existing callers, and all translation keys are freshly added without touching existing ones. The two flagged items are design notes for the upcoming API integration pass, not defects in the current code.

LastCycleSummaryModal/index.tsx and UserRewardsCard/index.tsx will need attention when real API data replaces the placeholder constants.

Important Files Changed

Filename Overview
apps/evm/src/pages/PrimeLeaderboard/LastCycleSummaryModal/index.tsx New modal composing TotalRewardsCard and UserRewardsCard for last-cycle data; eligibility-message branch is unreachable because placeholderHasRewards is hardcoded to true
apps/evm/src/pages/PrimeLeaderboard/UserRewardsCard/index.tsx Adds optional title, content, and showMarketActions props to enable reuse as a read-only summary; apyPercentage remains required in UserMarketReward even when showMarketActions={false} leaves it unused
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsCard/index.tsx Adds optional title prop with fallback to existing translation; clean, backward-compatible change
apps/evm/src/pages/PrimeLeaderboard/PrimeRewardBadge/index.tsx New shared badge component extracted from UserRewardsCard; straightforward presentational component
apps/evm/src/pages/PrimeLeaderboard/LastCycleSummaryModal/tests/index.spec.tsx Smoke test verifying modal title and both card titles render; only covers the placeholderHasRewards=true path — eligibility message branches have no test coverage
apps/evm/src/libs/translations/translations/en.json Adds lastCycleSummary translation block; eligibleMessage uses "in this cycle" phrasing that contradicts the last-cycle modal context
apps/evm/src/libs/translations/translations/ja.json Japanese translations for the new lastCycleSummary block
apps/evm/src/libs/translations/translations/th.json Thai translations for the new lastCycleSummary block
apps/evm/src/libs/translations/translations/tr.json Turkish translations for the new lastCycleSummary block
apps/evm/src/libs/translations/translations/vi.json Vietnamese translations for the new lastCycleSummary block
apps/evm/src/libs/translations/translations/zh-Hans.json Simplified Chinese translations for the new lastCycleSummary block
apps/evm/src/libs/translations/translations/zh-Hant.json Traditional Chinese translations for the new lastCycleSummary block

Reviews (2): Last reviewed commit: "fix: solve comments" | Re-trigger Greptile

@@ -37,15 +45,15 @@ export const UserRewardsCard: React.FC<UserRewardsCardProps> = ({
<div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Hardcoded "this cycle" label shown in last cycle modal

UserRewardsCard always renders the title from t('primeLeaderboard.userRewards.title') ("Your Prime rewards this cycle"), but LastCycleSummaryModal uses this card to display last cycle data. Unlike TotalRewardsCard, which received a new optional title prop to allow overriding the default text, UserRewardsCard has no equivalent mechanism — so the label will always read "this cycle" even when embedded in the Last Cycle Summary Modal.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Comment thread apps/evm/src/libs/translations/translations/en.json Outdated
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.66% 48097 / 58899
🔵 Statements 81.66% 48097 / 58899
🔵 Functions 62.58% 669 / 1069
🔵 Branches 72.91% 5458 / 7485
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/constants/prime.ts 99.08% 0% 100% 99.08% 1
apps/evm/src/pages/PrimeLeaderboard/EndOfCycle/index.tsx 100% 85.71% 66.66% 100%
apps/evm/src/pages/PrimeLeaderboard/LastCycleSummaryModal/index.tsx 100% 50% 100% 100%
apps/evm/src/pages/PrimeLeaderboard/LastCycleSummaryModal/UserRankCard/index.tsx 94.73% 0% 100% 94.73% 28-29
apps/evm/src/pages/PrimeLeaderboard/PrimeRewardBadge/index.tsx 0% 0% 0% 0% 1-17
apps/evm/src/pages/PrimeLeaderboard/TotalRewardsCard/index.tsx 100% 0% 100% 100%
apps/evm/src/pages/PrimeLeaderboard/UserRewardsCard/index.tsx 100% 85.71% 100% 100%
Generated in workflow #13656 for commit bd2ecf9 by the Vitest Coverage Report Action

@cuzz-venus

Copy link
Copy Markdown
Contributor Author

@greptile review again

cuzz-venus and others added 5 commits June 17, 2026 17:27
Replace the top total-rewards card with a user rank card that surfaces the
user's last-cycle rank, Prime score and one of three outcome messages
(qualified / missed top rank / not ranked), derived from the rank.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The last cycle summary user rewards card now always shows the rewards
amount (zero when none), so drop the eligibility content override and its
translations that are no longer used there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment on lines +4 to +5
// Maximum rank that qualifies for Prime during a cycle
export const PRIME_RANK_LIMIT = 500;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fetched from the contract (it could change in the future through a VIP).

},
"lastCycleSummary": {
"primeScoreLabel": "Prime score",
"rankLabel": "Your rank",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this to Zed yesterday, this should be "You ranked". Sorry for the last minute change.

Comment on lines +1267 to +1269
"rankMissed": "Almost there! You weren't in last cycle's top 500. Boost your stake to qualify this cycle.",
"rankNoStake": "You didn't stake XVS last cycle. Stake now to qualify for Prime and earn extra rewards.",
"rankQualified": "Congrats! You're in the Top 500 during last cycle and qualified for Prime Rewards.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These weren't proof read I think.

Suggested change
"rankMissed": "Almost there! You weren't in last cycle's top 500. Boost your stake to qualify this cycle.",
"rankNoStake": "You didn't stake XVS last cycle. Stake now to qualify for Prime and earn extra rewards.",
"rankQualified": "Congrats! You're in the Top 500 during last cycle and qualified for Prime Rewards.",
"rankMissed": "Almost there! You weren't in the top 500 last cycle. Increase your stake to qualify this cycle.",
"rankNoStake": "You didn't stake XVS during the last cycle. Stake now to qualify for Prime in the next cycle and earn extra rewards.",
"rankQualified": "Congrats! You were in the top 500 during the last cycle and qualified for Prime rewards.",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants